/* tslint:disable */
/* eslint-disable */
/*
Humanloop API

The Humanloop API allows you to interact with Humanloop from your product or service.

You can do this through HTTP requests from any language or via our official Python or TypeScript SDK.

To install the official [Python SDK](https://pypi.org/project/humanloop/), run the following command:

```bash
pip install humanloop
```

To install the official [TypeScript SDK](https://www.npmjs.com/package/humanloop), run the following command:

```bash
npm i humanloop
```

---

Guides and further details about key concepts can be found in [our docs](https://docs.humanloop.com/).

The version of the OpenAPI document: 4.0.1


NOTE: This file is auto generated by Konfig (https://konfigthis.com).
*/

import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, isBrowser } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
// @ts-ignore
import { FeedbackSubmitRequest } from '../models';
// @ts-ignore
import { FeedbackSubmitResponse } from '../models';
// @ts-ignore
import { FeedbackTypeProperty } from '../models';
// @ts-ignore
import { HTTPValidationError } from '../models';
import { paginate } from "../pagination/paginate";
import type * as buffer from "buffer"
import { requestBeforeHook } from '../requestBeforeHook';
/**
 * FeedbackApi - axios parameter creator
 * @export
 */
export const FeedbackApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Submit an array of feedback for existing `data_ids`
         * @summary Feedback
         * @param {FeedbackSubmitRequest} feedbackSubmitRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        feedback: async (feedbackSubmitRequest: FeedbackSubmitRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'feedbackSubmitRequest' is not null or undefined
            assertParamExists('feedback', 'feedbackSubmitRequest', feedbackSubmitRequest)
            const localVarPath = `/feedback`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions: AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {} as any;
            const localVarQueryParameter = {} as any;

            // authentication APIKeyHeader required
            await setApiKeyToObject({ object: localVarHeaderParameter, key: "X-API-KEY", keyParamName: "xAPIKEY", configuration })

    
            localVarHeaderParameter['Content-Type'] = 'application/json';


            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            requestBeforeHook({
                requestBody: feedbackSubmitRequest,
                queryParameters: localVarQueryParameter,
                requestConfig: localVarRequestOptions,
                path: localVarPath,
                configuration,
                pathTemplate: '/feedback',
                httpMethod: 'POST'
            });
            localVarRequestOptions.data = serializeDataIfNeeded(feedbackSubmitRequest, localVarRequestOptions, configuration)

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * FeedbackApi - functional programming interface
 * @export
 */
export const FeedbackApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = FeedbackApiAxiosParamCreator(configuration)
    return {
        /**
         * Submit an array of feedback for existing `data_ids`
         * @summary Feedback
         * @param {FeedbackApiFeedbackRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async feedback(requestParameters: FeedbackApiFeedbackRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FeedbackSubmitResponse>> {
            const feedbackSubmitRequest: FeedbackSubmitRequest = requestParameters;
            const localVarAxiosArgs = await localVarAxiosParamCreator.feedback(feedbackSubmitRequest, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
    }
};

/**
 * FeedbackApi - factory interface
 * @export
 */
export const FeedbackApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = FeedbackApiFp(configuration)
    return {
        /**
         * Submit an array of feedback for existing `data_ids`
         * @summary Feedback
         * @param {FeedbackApiFeedbackRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        feedback(requestParameters: FeedbackApiFeedbackRequest, options?: AxiosRequestConfig): AxiosPromise<FeedbackSubmitResponse> {
            return localVarFp.feedback(requestParameters, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * Request parameters for feedback operation in FeedbackApi.
 * @export
 * @interface FeedbackApiFeedbackRequest
 */
export type FeedbackApiFeedbackRequest = {
    
} & FeedbackSubmitRequest

/**
 * FeedbackApiGenerated - object-oriented interface
 * @export
 * @class FeedbackApiGenerated
 * @extends {BaseAPI}
 */
export class FeedbackApiGenerated extends BaseAPI {
    /**
     * Submit an array of feedback for existing `data_ids`
     * @summary Feedback
     * @param {FeedbackApiFeedbackRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof FeedbackApiGenerated
     */
    public feedback(requestParameters: FeedbackApiFeedbackRequest, options?: AxiosRequestConfig) {
        return FeedbackApiFp(this.configuration).feedback(requestParameters, options).then((request) => request(this.axios, this.basePath));
    }
}
